/*
 * @Author: CQJ
 * @Date: 2022-08-25 20:00:27
 * @LastEditors: CQJ
 * @LastEditTime: 2022-08-27 14:27:19
 * @Description:
 */
import { reactive } from 'vue'

interface ISiteState {
  // 站点类型
  site_type: number | undefined
  // 站点id
  site_id: string | undefined
  // 关键词
  site_keyword: string | undefined
}

// 状态管理
export const siteState = reactive<ISiteState>({
  site_type: undefined,
  site_id: undefined,
  site_keyword: undefined
})
interface IStatus {
  //列表类型切换
  isActiveModule: boolean
  isBySearch: boolean
  site_status: number
}
// 列表类型切换
export const statusState = reactive<IStatus>({
  isActiveModule: false,
  isBySearch: false,
  site_status: 1
})
export const resetState = () => {
  let key: keyof ISiteState
  for (key in siteState) {
    siteState[key] = undefined
  }
}
